<?php
  require_once('system/dbConnect.php');
  require_once('system/MyFunc.php'); 	
  connect();
  if(!empty($_FILES["wn_jiajulink"]["name"])){
    $wn_pic = uploadfile('wn_jiajulink','upload/',array('jpg','gif','png'));
  }
  else{
    $wn_jiajulink='';
  }
  $data = array(
		'wn_name' => trim($_POST['wn_name']),
    'wn_brand' => $_POST['wn_brand'],
    'wn_intro' => $_POST['wn_intro'],
    'wn_cid' => $_POST['wn_cid'],
    'wn_adddate' => $_POST['wn_adddate'],
    'wn_jiajulink'=>$wn_jiajulink,  
    'wn_ischecked' => $_POST['wn_ischecked']
		
  	);
	$result =add ('jiaju',$data);

  if(!$result){
    echo "添加失败！<br/>";
    echo "<a href='addjiaju.php'>返回</a>";   
  }
  else{   
   redirect('list.php','添加成功！'); 
  } 
?>
